<template>
  <div>
    <MyHeader title="tabbar案例" backgroundColor="skyblue"></MyHeader>
    <div class="main">
      <component :is="toCom"> </component>
    </div>
    <MyFooter @isCome="fn" :list="tabList"></MyFooter>
  </div>
</template>

<script>
import MyHeader from "@/components/MyHeader.vue";
import MyFooter from "@/components/tabbar/MyFooter.vue";
import MyGoodsList from "@/views/MyGoodsList.vue";
import MyGoodsSearch from "@/views/MyGoodsSearch.vue";
import MyUserInfo from "@/views/MyUserInfo.vue";
export default {
  components: {
    MyHeader,
    MyFooter,
    MyGoodsList,
    MyGoodsSearch,
    MyUserInfo,
  },
  data() {
    return {
      tabList: [
        {
          iconText: "icon-shangpinliebiao",
          text: "商品列表",
          componentName: "MyGoodsList",
        },
        {
          iconText: "icon-sousuo",
          text: "商品搜索",
          componentName: "MyGoodsSearch",
        },
        {
          iconText: "icon-user",
          text: "我的信息",
          componentName: "MyUserInfo",
        },
      ],
      toCom: "MyGoodsList",
    };
  },
  methods: {
    fn(uname) {
      this.toCom = uname;
    },
  },
};
</script>

<style scoped>
.main {
  padding-top: 45px;
  padding-bottom: 51px;
}
</style>
